function throttle (fn, delay) {
  let lastExecutionTime = 0;
  return function () {
    const now = Date.now();
    if (now - lastExecutionTime >= delay) {
      fn.apply(this, arguments);
      lastExecutionTime = now;
    }
  };
}

// 示例用法
function handleScroll () {
  console.log('Scroll event handled');
}

const throttledScrollHandler = throttle(handleScroll, 200);

window.addEventListener('scroll', throttledScrollHandler);